#include "Arguments.h"

namespace STC_calc
{

void Arguments::check_count_args(const string_list& args, const std::vector<int> count)
{
	for (int a : count)
	{
		if (args.size() == a) return;
	}
	throw(RuntimeErrorClass("Invalid number of arguments"));
}

void Arguments::arg_IF(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_IF1);
}
void Arguments::arg_IF0(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_IF0);
}
void Arguments::arg_IF1(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_IF1);
}

void Arguments::arg_SIMPLE(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_simple_count);
}
void Arguments::arg_FILE(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_standart_function);
}
void Arguments::arg_GRAPH(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_graphic);
	check_count_args(args, {0});
}
void Arguments::arg_INTEGRAL(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_graph_integr);
	check_count_args(args, {0});
}
void Arguments::arg_DIFF(const string_list& args)
{
    Config::set_mode(CurrentOptions::Modes::mode_graph_diff);
	check_count_args(args, {0});
}

void Arguments::arg_help(const string_list& args)
{
    Logger::help();
	check_count_args(args, {0});
}
void Arguments::arg_variable(string_list& args)
{
    Config::add_variable(args);
}
void Arguments::arg_constant(string_list &args)
{
    Config::add_constant(args);
}
void Arguments::arg_begin(const string_list& args)
{

}
void Arguments::arg_set_num_steps (const string_list& args)
{

}
void Arguments::arg_set_output_file (const string_list& args)
{

}
void Arguments::arg_set_degree_trigonometry (const string_list& args)
{

}

}
